#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Copyright © 启明星辰 版权所有
# @Time    : 2023/12/29 17:37
# @Author  : 胡浩浩
# @File    : report_model.py
# @IDE     : PyCharm
# @description :

from datetime import datetime
from typing import List
from pydantic import BaseModel
from tortoise import fields
from tortoise.models import Model


class ReportModel(Model):
    id = fields.IntField(pk=True, description="主键")
    url = fields.CharField(max_length=255, description="测试报告url")
    created_at = fields.CharField(max_length=255, description="创建时间")

    class Meta:
        table = "reports"


class ReportIn(BaseModel):
    url: str


class ReportOut(BaseModel):
    id: int
    url: str
    created_at: str


class ReportPage(BaseModel):
    total: int
    page_size: int
    current_page: int
    search_key: str = None
    results: List[ReportOut]
